/*
 * Project: BoboDesignPattern
 * 
 * File Created at 2019年2月17日
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package obsver.test2;

/**
 * @Type DO
 * @Desc
 * @author 52489
 * @date 2019年2月17日
 * @Version V1.0
 */
public class DO {
    public static void main(String[] args) {
        ConcreteSubject subject = new ConcreteSubject();
        ObserverA a = new ObserverA();
        ObserverA b = new ObserverA();
        ObserverA c = new ObserverA();
        subject.registerObserver(a);
        subject.registerObserver(b);
        subject.registerObserver(c);
        System.out.println(a.getMyState());
        // 对象状态修改通知所有
        subject.setState(2000);
        System.out.println(a.getMyState());
        System.err.println(b.getMyState());
    }
}
